package com.luodan.service;

import com.luodan.domain.User;
import com.luodan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("UserService")
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void saveUser(User user) {
        System.out.println("来到了服务层——————————————————");
        System.out.println(user);
        try {
            userMapper.addUser(user);
            System.out.println("——————————————————");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
